package com.aaa.controller;

import com.aaa.entity.TabUserRole;
import com.aaa.service.ITabUserRoleService;
import com.aaa.util.Result;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 于永利
 * @since 2024-08-03
 */
@RestController
@RequestMapping("/tab-user-role")

public class TabUserRoleController {

    @Autowired
    private ITabUserRoleService tabUserRoleService;

    //
    @GetMapping
    public Result findRolesByUid(Integer uid){
        Map<String,Object> map = new HashMap<>();
        map.put("uid",uid);

        List<TabUserRole> tabUserRoles = tabUserRoleService.listByMap(map);

        return Result.success(tabUserRoles);
    }

}
